<input type="button" onclick="test_save()" value="save"/>
<input type="button" onclick="test_clear()"  value="clear"/>
<pre>
	F12 Resources Local Storage
</pre>
<script type="text/javascript">
var jsonstr={'name':"haoning","no":123};
function save(dataModel){
	console.log(dataModel);
    var value = JSON.stringify(dataModel);//dataModel.serialize();
    window.localStorage['myname'] = value;
    localStorage.setItem("myage",12); 
    return value;
}

function clear(){
	console.log("---clear");
    if(window.localStorage['myname']){
		console.log("---delete myname myage");
        delete window.localStorage['myname']; 
        delete window.localStorage['myage'];       
    }   
}
function test_save(){
	save(jsonstr);
//	clear();
}
function test_clear(){
  clear();
}
//request = indexedDB.open("DataModel");
</script>
